
import rclpy
from rclpy.node import Node 
class personnode(Node):
    def __init__(self,node_name:str, name: str, age: int) -> None:
        
        super().__init__(node_name)
        self.age=age 
        self.name=name 
    def eat(self, food_name: str):
        self.get_logger(),info(f'I am {self.name} and {self.age},eating{food_name}')


     
def main():
    rclpy.init()
    node=personnode('person_node','zjq',19)
    node.eat=('niurou')
    node.get_logger().info('hello')
    rclpy.spin(node)
    rclpy.sgutdown()